<!DOCTYPE html>
<html>
    
    <head>
       <meta charset="UTF-8">
        {include="style"}
		<style>
		.layui-form-pane .layui-form-label {
			width: 150px;
			}
		.layui-form-pane .layui-form-item[pane] .layui-input-inline {
			margin-left: 150px;
		}
		</style>
		
    </head>
    
    <body>
	 <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>{fun JZLANG('首页')}</cite></a>
              <a><cite>{fun JZLANG('系统扩展')}</cite></a>
              <a><cite>{fun JZLANG('模型管理')}</cite></a>
			  <a><cite>{fun JZLANG('新增模型')}</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="{fun JZLANG('刷新')}"><i class="iconfont" style="line-height:30px">&#xe6aa;</i></a>
        </div>
        <div class="x-body">
            <form class="layui-form layui-form-pane" >
			<input type="hidden" name="go" value="1" />
		
                 <div class="layui-form-item ">
                    <label for="name" class="layui-form-label">
                        {fun JZLANG('模型名称')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="name"   name="name" required="" lay-verify="required"
                        autocomplete="off" class="layui-input">
                    </div>
                </div>
				
				 <div class="layui-form-item">
                    <label for="biaoshi" class="layui-form-label">
                        {fun JZLANG('模型标识')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="biaoshi"    name="biaoshi" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  {fun JZLANG('必须是英文字母，且不能是已存在的标识，标识即是数据库里的表名')}
				    </div>
                </div>
				 <div class="layui-form-item" pane>
                    <label for="ismust" class="layui-form-label">
                        {fun JZLANG('是否必选栏目')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="ismust" value="0" title="{fun JZLANG('否')}">
						<input type="radio" name="ismust" value="1" title="{fun JZLANG('是')}" checked>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  
					  {fun JZLANG('新增修改内容时必选')}
				    </div>
					
                 </div>
				 <div class="layui-form-item" pane>
                    <label for="isclasstype" class="layui-form-label">
                        {fun JZLANG('是否显示栏目')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="isclasstype" value="0" title="{fun JZLANG('否')}">
						<input type="radio" name="isclasstype" value="1" title="{fun JZLANG('是')}" checked>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  
					  {fun JZLANG('列表展示、录入内容、修改内容三个页面是否展示栏目')}
				    </div>
					
                 </div>
				 <div class="layui-form-item" pane>
                    <label for="iscontrol" class="layui-form-label">
                        {fun JZLANG('是否受权限控制')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="iscontrol" value="0" title="{fun JZLANG('否')}" checked>
						<input type="radio" name="iscontrol" value="1" title="{fun JZLANG('是')}" >
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  
					  {fun JZLANG('不同角色可以通过控制栏目权限来限制查看内容')}
				    </div>
					
                 </div>
				<div class="layui-form-item" pane>
                    <label for="isshowclass" class="layui-form-label">
                        {fun JZLANG('栏目绑定显示')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="isshowclass" value="0" title="{fun JZLANG('否')}">
						<input type="radio" name="isshowclass" value="1" title="{fun JZLANG('是')}" checked>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  
					  {fun JZLANG('栏目绑定时是否显示该模型')}
				    </div>
					
                 </div>
				 <div class="layui-form-item" pane>
                    <label for="ishome" class="layui-form-label">
                        {fun JZLANG('前台发布')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="ishome" value="0" title="{fun JZLANG('否')}">
						<input type="radio" name="ishome" value="1" title="{fun JZLANG('是')}" checked>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  
					  {fun JZLANG('前台是否允许发布')}
				    </div>
					
                 </div>
				<div class="layui-form-item">
                    <label for="list_html" class="layui-form-label">
                        {fun JZLANG('列表模板')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="list_html" value="lists.html"    name="list_html" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  {fun JZLANG('默认列表模板')}
				    </div>
                </div>
				<div class="layui-form-item">
                    <label for="details_html" class="layui-form-label">
                        {fun JZLANG('详情模板')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="details_html" value="details.html"    name="details_html" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  {fun JZLANG('默认详情模板')}
				    </div>
                </div>
				<div class="layui-form-item" pane>
                    <label for="isopen" class="layui-form-label">
                        {fun JZLANG('是否开启')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="isopen" value="0" title="{fun JZLANG('否')}" >
						<input type="radio" name="isopen" value="1" title="{fun JZLANG('是')}" checked>
                    </div>
                </div>
				<div class="layui-form-item">
                    <label for="orders" class="layui-form-label">
                        {fun JZLANG('排序')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="orders" value="100"    name="orders" 
                        autocomplete="off" class="layui-input">
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  {fun JZLANG('数值越小越靠前')}
				    </div>
                </div>
				<div class="layui-form-item" pane>
                    <label for="hastable" class="layui-form-label">
                        {fun JZLANG('已有表')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="hastable" value="0" title="{fun JZLANG('否')}" checked>
						<input type="radio" name="hastable" value="1" title="{fun JZLANG('是')}" >
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  {fun JZLANG('如果数据库已经有这个表了，就选择"是"，否则就选"不是"')}
				    </div>
					
                 </div>
				 <div class="layui-form-item" pane>
                    <label for="hastable" class="layui-form-label">
                        {fun JZLANG('是否可以预览')}
                    </label>
                    <div class="layui-input-inline">
                        <input type="radio" name="ispreview" value="0" title="{fun JZLANG('否')}" >
						<input type="radio" name="ispreview" value="1" title="{fun JZLANG('是')}" checked>
                    </div>
					<div class="layui-form-mid layui-word-aux">
					  {fun JZLANG('如果后台无法预览，则选择 “否” ，列表中将不会出现 [预览]')}
				    </div>
					
                 </div>
                
                <div class="layui-form-item" style="text-align:center;">
                    
                     <button  class="layui-btn" lay-filter="save" lay-submit="">
                        {fun JZLANG('保存')}
                    </button>
                </div>
            </form>
        </div>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
		<br/>
      
        <script>
            layui.use(['laydate','form','layer','upload'], function(){
                $ = layui.jquery;
              var form = layui.form
              ,layer = layui.layer;
			  laydate = layui.laydate;
			
			  
			    //监听提交
              form.on('submit(save)', function(data){
                //console.log(data);
                //发异步，把数据提交给php
				$.post("{fun U('Molds/addMolds')}",data.field,function(r){
				
					var r = JSON.parse(r);
					if(r.code==0){
						
						layer.confirm(r.msg, {
						  btn: ['{fun JZLANG('返回')}','{fun JZLANG('确定')}'] //按钮
						}, function(){
						
							{if($webconf['admintpl']=='tpl')}
							 window.location.href="{fun U('Molds/index')}";
							{else}
							 parent.location.reload();
						     parent.layer.close(index);
							{/if}
						   
						}, function(){
						   window.location.href=r.url;
						});
						
						
						
					}else{
						layer.alert(r.msg, {icon: 5});
					}
				});
				
               
                return false;
              });
            

           
              
              
            });
        </script>
      
    </body>

</html>